<?php

declare(strict_types=1);

namespace App\Controller\Rpc;

use App\Controller\AbstractController;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Service\RpcService\YunCangRpcService;

/**
 * 云仓RPC 消息统一入口
 * @Controller(prefix="/Rpc/YunCang")
 */
class YunCangController extends AbstractController
{
    /**
     * @RequestMapping(path="MessageReceive", methods="post")
     * 消息接收
     * @param RequestInterface $request
     */
    public function messageReceive(RequestInterface $request,YunCangRpcService $rpcService)
    {
        return $rpcService->receive($request->getParsedBody());
    }
}